#!/bin/env php
<?php

/**
 * @author Marien Fressinaud <dev@marienfressinaud.fr>
 * @license http://www.gnu.org/licenses/agpl-3.0.en.html AGPL
 */

if (php_sapi_name() !== 'cli') {
    die('This script must be called from command line.');
}

// Setup the Minz framework
$app_path = __DIR__;

include $app_path . '/vendor/autoload.php';
\App\Configuration::load('dotenv', $app_path);
\App\Configuration::$no_syslog_output = true;

$request = \Minz\Request::initFromCli($argv);

// Initialize the Application and execute the request to get a Response
$application = new \App\cli\Application();
$response = $application->run($request);

\Minz\Response::sendToCli($response);
